package com.platform.qujia.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.platform.qujia.dao.SysUserPosConfigMapper;
import com.platform.qujia.pojo.SysUserPosConfig;
import com.platform.qujia.service.ISysUserPosConfigService;
import com.platform.qujia.utils.CodeMsg;
import com.platform.qujia.utils.exception.CustomException;
import org.springframework.stereotype.Service;

/**
 * @date 2024/2/1
 */
@Service
public class SysUserPosConfigServiceImpl extends ServiceImpl<SysUserPosConfigMapper, SysUserPosConfig> implements ISysUserPosConfigService {
    @Override
    public SysUserPosConfig getByUserId(Long userId) {
        SysUserPosConfig posConfig = getById(userId);
        if (posConfig == null) {
            throw new CustomException(CodeMsg.USER_NOT_EXSIST);
        }
        return posConfig;
    }
}
